
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DimDeliveryType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
 drop table [dbo].[DimDeliveryType]

GO

CREATE TABLE [dbo].[DimDeliveryType] (
	[DeliveryTypeKey] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
	[DeliveryTypeIdentifier] [varchar] (30) NOT NULL,
	[DeliveryTypeFullName] [nvarchar] (150) NOT NULL,
	[DistributionCompany] [nvarchar] (100) NOT NULL,
	[IsInternational] [varchar] (3) NOT NULL,
	[DeliveryPeriod] [nvarchar] (50) NOT NULL,

	CONSTRAINT [PK_DeliveryType] PRIMARY KEY CLUSTERED (
		   [DeliveryTypeKey])

)

GO

grant references, select, insert, delete, update on [dbo].[DimDeliveryType] to [db_datawriter]

GO

grant select on [dbo].[DimDeliveryType] to [public]

GO

